package com.soft.knowledge.service;

import com.soft.knowledge.mapper.EbookSnapshotCustomMapper;
import com.soft.knowledge.resp.StatisticResp;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class EbookSnapshotService {
    @Resource
    EbookSnapshotCustomMapper ebookSnapshotCustomMapper;

    public void generateEbookSnapshot(){
        ebookSnapshotCustomMapper.generateEbookSnapshot();
    }

    /**
     * 获取首页数值数据：总阅读数、总点赞数、今日阅读数、今日点赞数、今日预计阅读数、今日预计阅读增长
     */
    public List<StatisticResp> getStatistic() {
        return ebookSnapshotCustomMapper.getStatistic();
    }

    public List<StatisticResp> get30Statistic() {
        return ebookSnapshotCustomMapper.get30Statistic();
    }
}
